import requests


session = requests.session()

data = {
    "username": "felix",
    "password": "admin"
}

host = "http://127.0.0.1:5000"
login_path = '/login'
getInfo_path = '/get_info'
login_url = host + login_path
getInfo_url = host + getInfo_path
res_login = session.post(url=login_url, json=data)
print(res_login.text)

res_getInfo = session.get(url=getInfo_url)
print(res_getInfo.text)
print(res_login.cookies)
print(session.cookies)
print(res_getInfo.cookies)



print("--------")

re_login = requests.post(url=login_url, json=data)
print(re_login.text)

re_getInfo = requests.get(url=getInfo_url)
print(re_getInfo.text)

